import 'dart:math';

import 'package:flutter/material.dart';

void main() => runApp(MyApp(
  items: List<String>.generate(100, (i) => 'item ${i+1}')
));

class MyApp extends StatelessWidget {
  final List<String> items;
  const MyApp({Key? key, required this.items}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'HelloFlutter',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('ListView Widget'),
        ),
        body: Center(
          child: Container(
            height: 200.0,
            color: Colors.green,
            child: ListView.builder(
              scrollDirection: Axis.horizontal,
              itemCount: items.length,
              itemBuilder: (context,index) {
                return SizedBox(
                  width: 150.0,
                  child: ListTile(
                    title: Text(items[index]),
                    leading: const Icon(Icons.star),
                  ),
                );
              }
            ),
          ),
        ),
      ),
    );
  }
}